{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Visualize Proba-V NDVI Comparison\n",
    "\n",
    "**Author:** René Kopeinig<br>\n",
    "**Description:** Comparison on Proba-V NDVI (Normalized Difference Vegetation Index) Imagery with help of Google Earth Engine Python API. One NDVI is derived on the fly, the other one is the actual NDVI band provided by Proba-V."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.display import Image\n",
    "import ee\n",
    "import folium\n",
    "ee.Initialize()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load Proba-V image collection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "probav = ee.ImageCollection('VITO/PROBAV/C1/S1_TOC_100M')\n",
    "\n",
    "# Reduce image collection to mean\n",
    "probav_mean = probav.mean()\n",
    "\n",
    "# Set location to Europe (Proba-V Footprint: X18Y02) \n",
    "point = ee.Geometry.Point(49.612485,6.134136)\n",
    "luxembourg = point.buffer(50000).bounds().getInfo()['coordinates']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Calculate and plot Proba-V NDVI \n",
    "This example is not using the NDVI band, instead it will be calculated from NIR and RED band."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgCiAgICAgICAgPHNjcmlwdD4K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ogNTAwLjBweDsKICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwLjAlOwogICAgICAgICAgICAgICAgICAgIHRvcDogMC4wJTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgPC9zdHlsZT4KICAgICAgICAKPC9oZWFkPgo8Ym9keT4gICAgCiAgICAKICAgICAgICAgICAgPGRpdiBjbGFzcz0iZm9saXVtLW1hcCIgaWQ9Im1hcF8xMDY4MWZlODFjMzE0NGU5OGNmYWRjZjU2OTg5YTQxYiIgPjwvZGl2PgogICAgICAgIAo8L2JvZHk+CjxzY3JpcHQ+ICAgIAogICAgCiAgICAgICAgICAgIHZhciBtYXBfMTA2ODFmZTgxYzMxNDRlOThjZmFkY2Y1Njk4OWE0MWIgPSBMLm1hcCgKICAgICAgICAgICAgICAgICJtYXBfMTA2ODFmZTgxYzMxNDRlOThjZmFkY2Y1Njk4OWE0MWIiLAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGNlbnRlcjogWzQ5LjYxMjQ4NSwgNi4xMzQxMzZdLAogICAgICAgICAgICAgICAgICAgIGNyczogTC5DUlMuRVBTRzM4NTcsCiAgICAgICAgICAgICAgICAgICAgem9vbTogNywKICAgICAgICAgICAgICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICBwcmVmZXJDYW52YXM6IGZhbHNlLAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApOwoKICAgICAgICAgICAgCgogICAgICAgIAogICAgCiAgICAgICAgICAgIHZhciB0aWxlX2xheWVyXzYzNzc5ZWJiMDIzZTQwNjJhMGEwYmYxY2ViY2I3NzRlID0gTC50aWxlTGF5ZXIoCiAgICAgICAgICAgICAgICAiaHR0cHM6Ly97c30udGlsZS5vcGVuc3RyZWV0bWFwLm9yZy97en0ve3h9L3t5fS5wbmciLAogICAgICAgICAgICAgICAgeyJhdHRyaWJ1dGlvbiI6ICJEYXRhIGJ5IFx1MDAyNmNvcHk7IFx1MDAzY2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hab29tIjogMTgsICJtaW5ab29tIjogMCwgIm5vV3JhcCI6IGZhbHNlLCAib3BhY2l0eSI6IDEsICJzdWJkb21haW5zIjogImFiYyIsICJ0bXMiOiBmYWxzZX0KICAgICAgICAgICAgKS5hZGRUbyhtYXBfMTA2ODFmZTgxYzMxNDRlOThjZmFkY2Y1Njk4OWE0MWIpOwogICAgICAgIAogICAgCiAgICAgICAgICAgIHZhciBsYXllcl9jb250cm9sXzUyYjVhNDQ0Njg5YzRhNWM5ZjNjNTk4ZGFkZDNlYzU2ID0gewogICAgICAgICAgICAgICAgYmFzZV9sYXllcnMgOiB7CiAgICAgICAgICAgICAgICAgICAgIm9wZW5zdHJlZXRtYXAiIDogdGlsZV9sYXllcl82Mzc3OWViYjAyM2U0MDYyYTBhMGJmMWNlYmNiNzc0ZSwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBvdmVybGF5cyA6ICB7CiAgICAgICAgICAgICAgICAgICAgIlByb2JhLVYgTkRWSSAxMDBNIiA6IHRpbGVfbGF5ZXJfZTc5Yzc2NDA3ZWQ3NDFhY2JjODA0OTc5YzMyY2E1YTYsCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9OwogICAgICAgICAgICBMLmNvbnRyb2wubGF5ZXJzKAogICAgICAgICAgICAgICAgbGF5ZXJfY29udHJvbF81MmI1YTQ0NDY4OWM0YTVjOWYzYzU5OGRhZGQzZWM1Ni5iYXNlX2xheWVycywKICAgICAgICAgICAgICAgIGxheWVyX2NvbnRyb2xfNTJiNWE0NDQ2ODljNGE1YzlmM2M1OThkYWRkM2VjNTYub3ZlcmxheXMsCiAgICAgICAgICAgICAgICB7ImF1dG9aSW5kZXgiOiB0cnVlLCAiY29sbGFwc2VkIjogdHJ1ZSwgInBvc2l0aW9uIjogInRvcHJpZ2h0In0KICAgICAgICAgICAgKS5hZGRUbyhtYXBfMTA2ODFmZTgxYzMxNDRlOThjZmFkY2Y1Njk4OWE0MWIpOwogICAgICAgIAo8L3NjcmlwdD4=\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x11eb135d0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ndvi = probav_mean.normalizedDifference([\"NIR\", \"RED\"])\n",
    "vis_ndvi= {'region':luxembourg,\n",
    "           'min':-0.5,\n",
    "           'max':0.5,\n",
    "           'palette':['ffffe5','f7fcb9','d9f0a3','addd8e','78c679','41ab5d','238443','006837','004529']}\n",
    "\n",
    "mapid = ndvi.getMapId(vis_ndvi)\n",
    "map = folium.Map(location=[49.612485,6.134136],zoom_start=7, height=500,width=700)\n",
    "folium.TileLayer(\n",
    "    tiles=mapid['tile_fetcher'].url_format,\n",
    "    attr='Map Data &copy; <a href=\"https://earthengine.google.com/\">Google Earth Engine</a>',\n",
    "    overlay=True,\n",
    "    name='Proba-V NDVI 100M',\n",
    "  ).add_to(map)\n",
    "\n",
    "map.add_child(folium.LayerControl())\n",
    "map"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot Proba-V NDVI \n",
    "This example is using the NDVI band."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgCiAgICAgICAgPHNjcmlwdD4KICAgICAgICAgICAgTF9OT19UT1VDSCA9IGZhbHNlOwogICAgICAgICAgICBMX0RJU0FCTEVfM0QgPSBmYWxzZTsKICAgICAgICA8L3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AgICAgICAgICAgIH0KICAgICAgICAgICAgPC9zdHlsZT4KICAgICAgICAKPC9oZWFkPgo8Ym9keT4gICAgCiAgICAKICAgICAgICAgICAgPGRpdiBjbGFzcz0iZm9saXVtLW1hcCIgaWQ9Im1hcF9hNjMxZGIwYzgyYzI0ZTk3YmUyYzk1Mjg4NDA0MWVjNSIgPjwvZGl2PgogICAgICAgIAo8L2JvZHk+CjxzY3JpcHQ+ICAgIAogICAgCiAgICAgICAgICAgIHZhciBtYXBfYTYzMWRiMGM4MmMyNGU5N2JlMmM5NTI4ODQwNDFlYzUgPSBMLm1hcCgKICAgICAgICAgICAgICAgICJtYXBfYTYzMWRiMGM4MmMyNGU5N2JlMmM5NTI4ODQwNDFlYzUiLAogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGNlbnRlcjogWzQ5LjYxMjQ4NSwgNi4xMzQxMzZdLAogICAgICAgICAgICAgICAgICAgIGNyczogTC5DUlMuRVBTRzM4NTcsCiAgICAgICAgICAgICAgICAgICAgem9vbTogNywKICAgICAgICAgICAgICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICBwcmVmZXJDYW52YXM6IGZhbHNlLAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApOwoKICAgICAgICAgICAgCgogICAgICAgIAogICAgCiAgICAgICAgICAgIHZhciB0aWxlX2xheWVyX2IyNjdhZDQ0YWY3MTRiMGY5NTg5M2RkOTllZDM3ZGY5ID0gTC50aWxlTGF5ZXIoCiAgICAgICAgICAgICAgICAiaHR0cHM6Ly97c30udGlsZS5vcGVuc3RyZWV0bWFwLm9yZy97en0ve3h9L3t5fS5wbmciLAogICAgICAgICAgICAgICAgeyJhdHRyaWJ1dGlvbiI6ICJEYXRhIGJ5IFx1MDAyNmNvcHk7IFx1MDAzY2EgaHJlZj1cImh0dHA6Ly9vcGVuc3RyZWV0bWFwLm9yZ1wiXHUwMDNlT3BlblN0cmVldE1hcFx1MDAzYy9hX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5zIjogImFiYyIsICJ0bXMiOiBmYWxzZX0KICAgICAgICAgICAgKS5hZGRUbyhtYXBfYTYzMWRiMGM4MmMyNGU5N2JlMmM5NTI4ODQwNDFlYzUpOwogICAgICAgIAogICAgCiAgICAgICAgICAgIHZhciBsYXllcl9jb250cm9sXzcyMGZhZjAwZTY5MTQ3ZmQ4NGIxZWFhZjc5YjYzZjYwID0gewogICAgICAgICAgICAgICAgYmFzZV9sYXllcnMgOiB7CiAgICAgICAgICAgICAgICAgICAgIm9wZW5zdHJlZXRtYXAiIDogdGlsZV9sYXllcl9iMjY3YWQ0NGFmNzE0YjBmOTU4OTNkZDk5ZWQzN2RmOSwKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBvdmVybGF5cyA6ICB7CiAgICAgICAgICAgICAgICAgICAgIlByb2JhLVYgTkRWSSAxMDBNIiA6IHRpbGVfbGF5ZXJfNzBhMTVlZGQ1YTY3NGE0N2E1YjMwOWVmMjY5MzI1ZTksCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9OwogICAgICAgICAgICBMLmNvbnRyb2wubGF5ZXJzKAogICAgICAgICAgICAgICAgbGF5ZXJfY29udHJvbF83MjBmYWYwMGU2OTE0N2ZkODRiMWVhYWY3OWI2M2Y2MC5iYXNlX2xheWVycywKICAgICAgICAgICAgICAgIGxheWVyX2NvbnRyb2xfNzIwZmFmMDBlNjkxNDdmZDg0YjFlYWFmNzliNjNmNjAub3ZlcmxheXMsCiAgICAgICAgICAgICAgICB7ImF1dG9aSW5kZXgiOiB0cnVlLCAiY29sbGFwc2VkIjogdHJ1ZSwgInBvc2l0aW9uIjogInRvcHJpZ2h0In0KICAgICAgICAgICAgKS5hZGRUbyhtYXBfYTYzMWRiMGM4MmMyNGU5N2JlMmM5NTI4ODQwNDFlYzUpOwogICAgICAgIAo8L3NjcmlwdD4=\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x11eba0910>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vis_ndvi= {'region':luxembourg,\n",
    "           'min':0,\n",
    "           'max':255,\n",
    "           'bands':['NDVI'],\n",
    "           'palette':['ffffe5','f7fcb9','d9f0a3','addd8e','78c679','41ab5d','238443','006837','004529']}\n",
    "\n",
    "mapid = probav_mean.getMapId(vis_ndvi)\n",
    "\n",
    "map = folium.Map(location=[49.612485,6.134136],zoom_start=7, height=500,width=700)\n",
    "folium.TileLayer(\n",
    "    tiles=mapid['tile_fetcher'].url_format,\n",
    "    attr='Map Data &copy; <a href=\"https://earthengine.google.com/\">Google Earth Engine</a>',\n",
    "    overlay=True,\n",
    "    name='Proba-V NDVI 100M',\n",
    "  ).add_to(map)\n",
    "\n",
    "map.add_child(folium.LayerControl())\n",
    "map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
